package com.ymatou.iapi.deviceid.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*返回逻辑设备号和物理设备号中关联最老的一条激活时间Call
*FreeMaker Template自动生成代码
*/
public class getFirstCall extends YmatouBaseCall{
	private static String opurl ="getFirst";
	
	public getFirstCall() {
		super(EnvSetup.getSystemUrl("deviceid"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public String getCode()
	{
	    return getString("code");
	}
	
	public String getBCode()
	{
	    return getString("bcode");
	}
	
	public String getMSG()
	{
	    return getString("msg");
	}
	
	public String getData()
	{
	    return getString("data");
	}
	
	public String getErrorCode()
	{
		String data = null;
		try {
			data = new JSONObject(getData()).getString("errorCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
	
	public String getErrorMessage()
	{
		String data = null;
		try {
			data = new JSONObject(getData()).getString("errorMessage");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
	
	public String getActiveTime()
	{
		String data = null;
		try {
			data = new JSONObject(getData()).getString("activeTime");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
	
	public String getUserId()
	{
		String data = null;
		try {
			data = new JSONObject(getData()).getString("userId");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
	
	public String getSignVerified()
	{
		String data = null;
		try {
			data = new JSONObject(getData()).getString("signVerified");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
	
	public String getSuccess()
	{
		String data = null;
		try {
			data = new JSONObject(getData()).getString("success");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
}